<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <!-- 导入基础样式 -->
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/change_pwd.css">
    <script src="../js/change_pwd.js"></script>
</head>
<body>
<div class="container">
    <form id="changeFrom" method="post">
        <h2>修改密码</h2>
        <div class="item">登录名称：<input type="text" name="username" id="username" required></div>
        <div class="item">修改密码：<input type="password" name="password" id="password" required></div>
        <div class="item">确认密码：<input type="password" name="again_password" id="again_password" required></div>
        <div class="button">
            <input type="button" value="确认" onclick="change_pwd()">
            <input type="reset" value="重置" id="reset">
        </div>
    </form>
</div>
<script>
    function change_pwd(){
        $.ajax({
            url:"/hotel/changePwd",
            type:"post",
            data:$("#changeFrom").serialize(),//序列化传值作用
            success:function(data){
                alert("修改密码成功")
                    window.location.href = 'login.html';
            }
        })
    }

</script>
</body>
</html>